﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SweeperPrototype.Business.Fields
{
    public class Timestamp
    {
        private readonly DateTime m_Value;

        public Timestamp( DateTime value)
        {
            m_Value = value;
        }

        public DateTime Value
        {
            get { return m_Value; }
        }

        public override string ToString()
        {
            return m_Value.ToString();
        }

        public bool Equals(Timestamp other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other.m_Value.Equals(m_Value);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Timestamp)) return false;
            return Equals((Timestamp) obj);
        }

        public override int GetHashCode()
        {
            return m_Value.GetHashCode();
        }
    }
}